package com.difsonapps.contacttranslator.service.impl;

import java.util.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.difsonapps.contacttranslator.dao.UserTransactionDAO;
import com.difsonapps.contacttranslator.dto.UserTransactionDTO;
import com.difsonapps.contacttranslator.service.itf.UserTransactionService;

@Repository
@Transactional
public class UserTransactionServiceImpl implements UserTransactionService {
	@Autowired
	protected UserTransactionDAO userTransactionDAO;

	@Transactional
	public void insert(UserTransactionDTO userTransactionDTO) {
		userTransactionDAO.insert(userTransactionDTO);
	}

	@Transactional
	public void update(UserTransactionDTO userTransactionDTO) {
		userTransactionDAO.update(userTransactionDTO);
	}

	@Transactional
	public UserTransactionDTO get(int id) {
		return userTransactionDAO.get(id);
	}

	@SuppressWarnings("unchecked")
	@Transactional
	public List<UserTransactionDTO> getAll() {
		return userTransactionDAO.getAll();
	}

	@Transactional
	public void delete(UserTransactionDTO userTransactionDTO) {
		userTransactionDAO.delete(userTransactionDTO);
	}
}
